package actions;



import java.util.Map;

import dominio.Usuario;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class eliminarCuenta extends ActionSupport{

	private static final long serialVersionUID = 1L;

	private Usuario us;
	private Long id;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public String execute(){	
		us = new Usuario();
		us.setId(id);
		System.out.println(us.getId());
		if(us.delete(false)){
			Map session = ActionContext.getContext().getSession();
			session.remove("usu");
			return SUCCESS;
		}else{
			return ERROR;
		}
		
	}

}
